home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Graphics 2D / BrightContrastEngine / BCEngine.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  3.3 KB  |  124 lines  |  [TEXT/CWIE]

  1. //****************************************************************************************
  2. // BCEngine.h
  3. //
  4. // Copyright 1999 by Apple Computer, Inc.
  5. //----------------------------------------------------------------------------------------
  6.  
  7.  
  8. #ifndef __BCENGINE__
  9. #define __BCENGINE__
  10.  
  11. #if PRAGMA_ONCE
  12. #pragma once
  13. #endif
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. #if PRAGMA_IMPORT
  20. #pragma import on
  21. #endif
  22.  
  23. #if PRAGMA_STRUCT_ALIGN
  24.     #pragma options align=mac68k
  25. #elif PRAGMA_STRUCT_PACKPUSH
  26.     #pragma pack(push, 2)
  27. #elif PRAGMA_STRUCT_PACK
  28.     #pragma pack(2)
  29. #endif
  30.  
  31. //----------------------------------------------------------------------------------------
  32. // Public Constants
  33. //----------------------------------------------------------------------------------------
  34.  
  35. // Brightness/Contrast Engine SubType
  36. enum {
  37.     kContrastEngineComponentSubType             = 'cont',
  38.     kOldContrastEngineComponentSubType             = 'bice'
  39. };
  40.  
  41. // Notification Constants
  42. enum {
  43.     kContrastChanged            = FOUR_CHAR_CODE('cchn'),
  44.     kBrightnessChanged            = FOUR_CHAR_CODE('bchn'),
  45.     kAVNotifyDeviceReset        = FOUR_CHAR_CODE('rset')    
  46. };
  47.  
  48. // Brightness/Contrast Engine Interface Version
  49. enum {
  50.     kContrastEngineComponentInterfaceRev         = 1L
  51. };
  52.  
  53. // Brightness/Contrast Engine Component selectors
  54. enum {
  55.     kContrastEngineGetBrightnessRangeSelect     = 0,
  56.     kContrastEngineGetBrightnessSelect             = 1,
  57.     kContrastEngineSetBrightnessSelect             = 2,
  58.     kContrastEngineGetContrastRangeSelect         = 3,
  59.     kContrastEngineGetContrastSelect             = 4,
  60.     kContrastEngineSetContrastSelect             = 5
  61. };
  62.  
  63.  
  64. //----------------------------------------------------------------------------------------
  65. // Public Types
  66. //----------------------------------------------------------------------------------------
  67.  
  68. typedef ComponentInstance                 ContrastEngineComponent;
  69. typedef ComponentResult                 ContrastEngineResult;
  70.  
  71.  
  72. //----------------------------------------------------------------------------------------
  73. // Public Prototypes
  74. //----------------------------------------------------------------------------------------
  75.  
  76. pascal ContrastEngineResult
  77. ContrastEngineGetBrightnessRange (ComponentInstance     ec,
  78.                                  short *                min,
  79.                                  short *                max)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0000, 0x7000, 0xA82A);
  80.  
  81. pascal ContrastEngineResult
  82. ContrastEngineGetBrightness        (ComponentInstance         ec,
  83.                                  short *                brightness)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  84.  
  85. pascal ContrastEngineResult
  86. ContrastEngineSetBrightness        (ComponentInstance         ec,
  87.                                  short                     brightness)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0x0002, 0x7000, 0xA82A);
  88.  
  89. pascal ContrastEngineResult
  90. ContrastEngineGetContrastRange    (ComponentInstance         ec,
  91.                                  short *                min,
  92.                                  short *                max)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  93.  
  94. pascal ContrastEngineResult
  95. ContrastEngineGetContrast        (ComponentInstance         ec,
  96.                                  short *                contrast)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  97.  
  98. pascal ContrastEngineResult
  99. ContrastEngineSetContrast        (ComponentInstance         ec,
  100.                                  short                     contrast)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0x0005, 0x7000, 0xA82A);
  101.  
  102.  
  103.  
  104. #if PRAGMA_STRUCT_ALIGN
  105.     #pragma options align=reset
  106. #elif PRAGMA_STRUCT_PACKPUSH
  107.     #pragma pack(pop)
  108. #elif PRAGMA_STRUCT_PACK
  109.     #pragma pack()
  110. #endif
  111.  
  112. #ifdef PRAGMA_IMPORT_OFF
  113. #pragma import off
  114. #elif PRAGMA_IMPORT
  115. #pragma import reset
  116. #endif
  117.  
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121.  
  122. #endif // __BCENGINE__
  123.  
  124.